﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AdminMP.Master" AutoEventWireup="true"
    CodeBehind="listausuarios.aspx.cs" Inherits="Admin.cadastros.listausuarios" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" src="../scripts/jquery-ui-1.8.16.custom/js/jquery-ui-1.8.16.custom.min.js"></script>
    <link rel="stylesheet" type="text/css" href="../scripts/jquery-ui-1.8.16.custom/css/custom-theme/jquery-ui-1.8.16.custom.css" />
    <script src="../scripts/js/combo.js" type="text/javascript"></script>
    <script src="../scripts/colorbox/jquery.colorbox-min.js" type="text/javascript"></script>
    <link href="../scripts/colorbox/colorbox.css" rel="stylesheet" type="text/css" />
    <style>
        .ui-button
        {
            margin-left: -1px;
        }
        .ui-button-icon-only .ui-button-text
        {
            padding: 0.35em;
        }
        .ui-autocomplete-input
        {
            margin: 0;
            padding: 0.48em 0 0.47em 0.45em;
        }
        
        .Campo
        {
            font-size: 12px;
            font-weight: bold;
            font-family: 'Verdana' , 'Lucida Sans Unicode' , 'Lucida Grande' , 'Sans-Serif';
            padding: 10px 0 10px 0;
            color: #8B4513;
            text-decoration: none;
            display: block;
        }
    </style>
    <script type="text/javascript">

                                    
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div style="width: 100%; padding-top: 20px">
        <div id="filtro" style="float: left; clear: both; padding: 10px 0px 20px 20px; margin-left: 45px">
            <fieldset style="width: 780px;">
                <legend class="labelCadastro">Filtos</legend>
                <table style="width: 100%">
                    <tr>
                        <td>
                            <label for="txtNomPro" class="labelCadastro">
                                Nome de usuário:</label>
                            <asp:TextBox ID="txtNomPro" runat="server" ClientIDMode="Static"></asp:TextBox>
                        </td>
                        <td>
                            <div class="ui-widget" style="float: left">
                                <label for="cmbTipo" class="labelCadastro">
                                    Situação:</label>
                                <asp:DropDownList ID="cmbSituacao" runat="server" DataTextField="SitNome" DataValueField="SitCod">
                                </asp:DropDownList>
                            </div>
                        </td>
                        <td style="text-align: right">
                            <asp:Button ID="btnPesquisar" CssClass="botao" runat="server" OnClick="btnPesquisar_Click"
                                Text="Pesquisar" />
                        </td>
                        <td style="text-align: right">
                            <a href="#novo" title="Novo" class="botaoNovo">Novo</a>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </div>
        <br />
        <br />
        <asp:UpdatePanel ID="upLista" runat="server" UpdateMode="Conditional">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnPesquisar" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnSalvar" EventName="Click" />
            </Triggers>
            <ContentTemplate>
                <table class="tabela" style="width: 90%;">
                    <thead class="cabecalho">
                        <tr>
                            <th scope="col" colspan="5">
                                <strong>Usuários</strong>
                            </th>
                        </tr>
                        <tr>
                            <th scope="col" colspan="1">
                                <strong>Login</strong>
                            </th>
                            <th scope="col" colspan="1">
                                <strong>Nome</strong>
                            </th>
                            <th scope="col" colspan="1">
                                <strong>E-mail</strong>
                            </th>
                            <th scope="col" colspan="1">
                                <strong>Telefone</strong>
                            </th>
                            <th scope="col" colspan="1">
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <asp:ListView ID="lista" runat="server">
                            <ItemTemplate>
                                <tr>
                                    <td colspan='1'>
                                        <%# DataBinder.Eval(Container.DataItem, "UsuLog") %>
                                    </td>
                                    <td colspan='1'>
                                        <%# DataBinder.Eval(Container.DataItem, "UsuNom") %>
                                    </td>
                                    <td colspan='1'>
                                        <%# DataBinder.Eval(Container.DataItem, "UsuMai") %>
                                    </td>
                                    <td colspan='1'>
                                        <%# DataBinder.Eval(Container.DataItem, "UsuTel")%>
                                    </td>
                                    <td colspan='1'>
                                        <a id="<%#DataBinder.Eval(Container.DataItem, "UsuLog")%>" class="Editar">Editar</a>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:ListView>
                    </tbody>
                </table>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <div style="display: none; visibility: hidden">
        <asp:UpdatePanel runat="server" ID="upNovo" UpdateMode="Conditional">
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnSalvar" EventName="Click" />
            </Triggers>
            <ContentTemplate>
                <asp:TextBox ID="login" runat="server" ClientIDMode="Static"></asp:TextBox>
                <asp:TextBox ID="nome" runat="server" ClientIDMode="Static"></asp:TextBox>
                <asp:TextBox ID="senha" runat="server" ClientIDMode="Static"></asp:TextBox>
                <asp:TextBox ID="email" runat="server" ClientIDMode="Static"></asp:TextBox>
                <asp:TextBox ID="telefone" runat="server" ClientIDMode="Static"></asp:TextBox>
                <asp:TextBox ID="situacao" runat="server" ClientIDMode="Static"></asp:TextBox>
                <div style="width: 650px" id="novo">
                    <fieldset>
                        <legend class="labelCadastro">Cadastro de usuários</legend>
                        <ul>
                            <li id="Login" class="Campo"><span style="letter-spacing: 1px; margin-right: 30px;">
                                Login: </span>
                                <asp:TextBox ID="txtLogin" runat="server" ClientIDMode="Static"></asp:TextBox></li>
                            <li id="Nome" class="Campo"><span style="letter-spacing: 1px; margin-right: 32px;">Nome:</span><asp:TextBox
                                ID="txtNome" runat="server" MaxLength="80" Width="450px" ClientIDMode="Static"></asp:TextBox>
                            </li>
                            <li id="trocaSenha" class="Campo"><a id="VerSenha" style="font-size: 10px;" onclick="$('#Senha').show('blind');$('#trocaSenha').hide('blind');">
                                Trocar senha</a></li>
                            <li id="Senha" class='Campo'><span style='letter-spacing: 1px; margin-right: 30px;'>
                                Senha:</span><asp:TextBox ID='txtSenha' runat='server' MaxLength='10' TextMode='Password'
                                    ClientIDMode='Static'></asp:TextBox>
                                <span style='letter-spacing: 1px; margin-right: 15px; margin-left: 20px'>Confirma Senha:</span><asp:TextBox
                                    ID='txtConfirmPass' runat='server' MaxLength='10' TextMode='Password' ClientIDMode='Static'></asp:TextBox></li>
                            <li id="Email" class="Campo"><span style="letter-spacing: 1px; margin-right: 28px;">
                                E-mail:</span><asp:TextBox ID="txtEmail" runat="server" MaxLength="60" Width="300px"
                                    ClientIDMode="Static"></asp:TextBox></li>
                            <li id="Telefone" class="Campo"><span style="letter-spacing: 1px; margin-right: 12px;">
                                Telefone:</span><asp:TextBox ID="txtTelefone" runat="server" ClientIDMode="Static"></asp:TextBox>
                                <span style="letter-spacing: 1px; margin-right: 15px; margin-left: 20px;">Celular:</span><asp:TextBox
                                    ID="txtCelular" runat="server" ClientIDMode="Static"></asp:TextBox></li>
                            <li id="Situacai" class="Campo"><span style="letter-spacing: 1px; margin-right: 9px;">
                                Situação:</span> <span class="ui-widget">
                                    <asp:DropDownList ID="cmdCadSituacao" runat="server" DataTextField="SitNome" DataValueField="SitCod"
                                        ClientIDMode="Static">
                                    </asp:DropDownList>
                                </span></li>
                            <li style="display: block;"><span style="margin-right: 100px;">
                                <asp:LinkButton ID="btnSalvar" CssClass="btnSalvar" runat="server" OnClick="btnSalvar_Click"
                                    OnClientClick="Salva()">Salvar</asp:LinkButton></span> </li>
                        </ul>
                    </fieldset>
                </div>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
